package jh.com.jhappbf.verify;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import androidx.fragment.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import jh.com.jhappbf.R;

/**
 * @author Administrator
 */
public class VerifyManager extends Fragment implements OnClickListener {

    private RelativeLayout mFinanceLayout;
    private RelativeLayout mControlLayout;
    private RelativeLayout mPrivilegeLayout;
    private Context mContext;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View v = inflater.inflate(R.layout.contract_main_activity, null);
        initView(v);
        return v;
    }

    /**
     * 初始化
     *
     * @param
     */
    private void initView(View v) {
        mFinanceLayout = v.findViewById(R.id.verify_finance_layout);
        mControlLayout = v.findViewById(R.id.verify_control_layout);
        mPrivilegeLayout = v.findViewById(R.id.verify_privilege_layout);
        mContext = getActivity().getApplicationContext();
        mFinanceLayout.setOnClickListener(this);
        mControlLayout.setOnClickListener(this);
        mPrivilegeLayout.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        Intent i = null;
        switch (v.getId()) {
            case R.id.verify_finance_layout:
                i = new Intent(getActivity(), VerifyDispatchListView.class);
                break;
            case R.id.verify_control_layout:
                break;
            case R.id.verify_privilege_layout:
                break;
            default:
                break;
        }

        if (i != null) {
            startActivity(i);
        }
    }
}
